package com.example.gb28181.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @E-mail cwm3412638@163.com
 * @Author cwm
 * @Date 2022/7/21
 */
@Getter
@AllArgsConstructor
public enum MessageEnum {
    /**
     * 心跳命令
     */
    MESSAGE_KEEP_ALIVE("Keepalive", "心跳命令");
    /**
     * 命令名
     */
    private final String name;
    /**
     * 描述
     */
    private final String describe;

    /**
     * 根据名称获取枚举
     *
     * @param eqName
     * @return
     */
    public static MessageEnum getMethodEnumByName(String eqName) {
        MessageEnum[] values = MessageEnum.values();
        for (MessageEnum messageEnum : values
        ) {
            if (messageEnum.name.equals(eqName)) {
                return messageEnum;
            }
        }
        return null;
    }
}
